<?php
	namespace App\Http\Controllers\equity;
            
	use Illuminate\Http\Request;
	use App\Http\Controllers\Controller;
	use App\Http\Requests;
	use App\Http\KitController;
	use App\Model\Login;
	use App\Model\Equity;
	use Illuminate\Support\Facades\DB;


	class QueryidController extends Controller{
		public function query(){
			return view("query");
	}
		public function login(Request $request){
			$username=$request->input("username");
			$password=$request->input("password");
			$userInput = $request->input('captcha');
			$login = Login::where('username', $username)->first();
			if($login){
				if($login->password == $password){
					$info=$request->session()->get('milkcaptcha');
					if($info==$userInput){
					    //用户输入验证码正确
					    $all=Equity::all();
					    	return view("result",[
					'all' => $all,
					]);
			
	
				}
				else{
 					return "验证失败";
				}
					   

				}
				else{
					echo "密码错误";
				}
			}
			else{
				echo "登陆失败";
			}



	

		}
		
}

?>